<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>运行情况</title>
		<link rel="stylesheet" type="text/css" href="/scripts/jquery-easyui-1.6.6/themes/default/easyui.css">
		<link rel="stylesheet" type="text/css" href="/scripts/jquery-easyui-1.6.6/themes/icon.css">
		<script type="text/javascript" src="/scripts/jquery-easyui-1.6.6/jquery.min.js"></script>
		<script type="text/javascript" src="/scripts/jquery-easyui-1.6.6/jquery.easyui.min.js"></script>
		<script type="text/javascript" src="/scripts/jquery-easyui-1.6.6/locale/easyui-lang-zh_CN.js"></script>
		<script type="text/javascript" src="/scripts/project.js"></script>
		<script type="text/javascript">
			function parseURL() {
				var url = location.search
				var url = url.split("?")[1];
				var para = url.split("&");
				var len = para.length;
				var res = {};
				var arr = [];
				for(var i = 0; i < len; i++) {
					arr = para[i].split("=");
					res[arr[0]] = arr[1];
				}
				return res;
			}
		</script>
	</head>

	<body>
		<table id="runinfo" class="easyui-datagrid" title="" style="width: 800px; height: 500px" data-options="
			rownumbers:true,singleSelect:true,pagination:true" toolbar="#rdtoolbar">
			<thead>
				<tr>
					<th data-options="field:'result',width:70">运行结果</th>
					<th data-options="field:'caseName',width:280">用例（脚本）名</th>
					<th data-options="field:'cli',width:90">客户端</th>
					<th data-options="field:'stime',width:160">开始时间</th>
					<th data-options="field:'etime',width:160">结束时间</th>
				</tr>
			</thead>
		</table>

		<div id="errdlg" class="easyui-dialog" style="width:600px;height:360px;padding:10px 20px" closed="true" buttons="#adddlg-buttons">
			<div class="ftitle"></div>
			<p id="msg"></p>
		</div>
		<script type="text/javascript">
			var param = parseURL();
			console.log(param);
			$('#runinfo').datagrid({
				url:'runinfo?pid='+param.pid+'&rid='+param.rid,
				method: 'get',
				onDblClickRow: function(index, row) {
					console.log(row),
					show_err(row.id,row.failReason)
				}
			})
			
			function show_err(info_id,msg){
				$('#errdlg').dialog('open').dialog('setTitle', '脚本运行失败信息');
				var obj=document.getElementById("msg");
				obj.innerText=msg;
			}
		</script>
	</body>

</html>